Double-ended priority queue